/*
 * PlanetSelection.h
 *
 *  Created on: 2011-5-5
 *      Author: Administrator
 */

#ifndef PLANETSELECTION_H_
#define PLANETSELECTION_H_

#include <FBase.h>
#include <FGraphics.h>
#include <FUi.h>

namespace Galaxy{

class PlanetsMap;
class GalaxyThread;
class Planet;

class PlanetSelection : public Osp::Ui::ITouchEventListener {
public:
	PlanetSelection(GalaxyThread* pThread, Osp::Base::Collection::ArrayList* pPlanets, int width, int height);
	virtual ~PlanetSelection();

public:
	virtual void OnTouchPressed(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo & touchInfo);
	virtual void OnTouchLongPressed(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchReleased(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchMoved(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchDoublePressed(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchFocusIn(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchFocusOut(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);

public:
	void Attack();
	void DoDraw(Osp::Graphics::Canvas* pCanvas);

public:
	Osp::Base::Collection::ArrayList* __pSelectedPlanets;
	PlanetsMap* __pMap;
	GalaxyThread* __pThread;
	Planet* __pSelectedPlanet;
	int __selectedRadius;

	//
	Osp::Graphics::Color* __pPlanetColor;
	Osp::Graphics::Color* __pSelectedColor;
};
}


#endif /* PLANETSELECTION_H_ */
